//
//  MeInfoViewMode.m
//  fitness-iOS
//
//  Created by 卢仕彤 on 2017/11/10.
//  Copyright © 2017年 卢仕彤. All rights reserved.
//

#import "MeInfoViewMode.h"
#import "FFGlobalHeader.h"

@implementation MeInfoViewMode

@end


@interface MeHeadInfoCell ()

@property (nonatomic, strong) UIImageView *headIconView;
@property (nonatomic, strong) UILabel *userNameLabel;
@property (nonatomic, strong) UILabel *introductionLabel;
@property (nonatomic, strong) UILabel *fanNumberLabel;
@property (nonatomic, strong) UILabel *followNumberLabel;

@end

@implementation MeHeadInfoCell

#pragma -mark lazy init

- (UIImageView *)headIconView {
    if (!_headIconView) {
        _headIconView = [UIImageView new];
    }
    return _headIconView;
}

- (UILabel *)userNameLabel {
    if (!_userNameLabel) {
        _userNameLabel = [UILabel labelWithSystemFontSize:14 textColorHexString:@"#333333"];
    }
    return _userNameLabel;
}

-(UILabel *)introductionLabel {
    if (!_introductionLabel) {
        _introductionLabel = [UILabel labelWithSystemFontSize:13 textColorHexString:@"#333333"];
    }
    return _introductionLabel;
}

- (UILabel *)fanNumberLabel {
    if (!_fanNumberLabel) {
        _fanNumberLabel = [UILabel labelWithSystemFontSize:12 textColorHexString:@"#333333"];
    }
    return _fanNumberLabel;
}

- (UILabel *)followNumberLabel {
    if (!_followNumberLabel) {
        _followNumberLabel = [UILabel labelWithSystemFontSize:11 textColorHexString:@"#333333"];
    }
    return _followNumberLabel;
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    [self.contentView addSubview:[self headIconView]];
    self.headIconView.backgroundColor = [UIColor redColor];
    self.headIconView.layer.cornerRadius = 30;
    [self.headIconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(30);
        make.top.equalTo(self.contentView.top).offset(30);
        make.size.equalTo(@(60));
    }];
    
    
    [self.contentView addSubview:[self userNameLabel]];
    self.userNameLabel.textAlignment = NSTextAlignmentLeft;
    self.userNameLabel.text = @"很厉害的人";
    [self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headIconView.right).offset(15);
        make.top.equalTo(self.headIconView.top);
    }];
    
    [self.contentView addSubview:[self introductionLabel]];
    self.introductionLabel.text = @"简介";
    [self.introductionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.userNameLabel.left);
        make.top.equalTo(self.userNameLabel.bottom).offset(15);
    }];
    
    [self.contentView addSubview:[self fanNumberLabel]];
    self.fanNumberLabel.text = @"粉丝100";
    [self.fanNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.introductionLabel.left);
        make.top.equalTo(self.introductionLabel.bottom).offset(10);
    }];
    
    [self.contentView addSubview:[self followNumberLabel]];
    self.followNumberLabel.text = @"关注数 100";
    [self.followNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.fanNumberLabel.right).offset(30);
        make.top.equalTo(self.fanNumberLabel.top);
    }];
    
}

@end

@interface MeCenterCell ()

@property (nonatomic, strong) UIImageView *medalView;

@property (nonatomic, strong) UILabel *circleLabel;

@end

@implementation MeCenterCell

- (UIImageView *)medalView {
    if (!_medalView) {
        _medalView = [UIImageView new];
    }
    return _medalView;
}

- (UILabel *)circleLabel {
    if (!_circleLabel) {
        _circleLabel =  [UILabel labelWithSystemFontSize:13 textColorHexString:@"#666666"];
    }
    return _circleLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}
- (void)initView {
    [self.contentView addSubview:[self circleLabel]];
    self.circleLabel.text = @"所在的圈子";
    [self.circleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(30);
        make.top.equalTo(self.contentView.top).offset(15);
    }];
    
    
    [self.contentView addSubview:[self medalView]];
    self.medalView.backgroundColor = [UIColor grayColor];
    [self.medalView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.circleLabel.left);
        make.centerY.equalTo(self.contentView.centerY);
        make.size.equalTo(CGSizeMake(80, 80));
    }];
    
}

@end

@interface MeDynamicCell ()

@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *infoLabel;
@property (nonatomic, strong) UIImageView *circleImageView;

@end

@implementation MeDynamicCell

- (UIImageView *)iconImageView {
    if (!_iconImageView) {
        _iconImageView  = [UIImageView new];
    }
    return _iconImageView;
}

- (UILabel *)infoLabel {
    if (!_infoLabel) {
        _infoLabel = [UILabel labelWithSystemFontSize:13 textColorHexString:@"#333333"];
    }
    return _infoLabel;
}

- (UIImageView *)circleImageView {
    if (!_circleImageView) {
        _iconImageView = [UIImageView new];
    }
    return _circleImageView;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView {
    [self.contentView addSubview:[self iconImageView]];
    self.iconImageView.backgroundColor = [UIColor darkGrayColor];
    self.iconImageView.layer.cornerRadius = 10;
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(15);
        make.top.equalTo(self.contentView.top).offset(15);
        make.size.equalTo(CGSizeMake(80, 80));
    }];
    
    
    [self.contentView addSubview:[self infoLabel]];
    self.infoLabel.text = @"相关信息描述";
    [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconImageView.left).offset(15);
        make.centerY.equalTo(self.iconImageView.centerY);
    }];
    
    [self.contentView addSubview:[self circleImageView]];
    self.circleImageView.layer.cornerRadius = 45;
    [self.circleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.infoLabel.left);
        make.top.equalTo(self.infoLabel.bottom).offset(15);
    }];
    
}

@end

